#ifndef MA_ERROR_CODE_H
#define MA_ERROR_CODE_H

#include <stdio.h>

typedef enum {
    ERR_SUCCESS = 0,
    NULL_PTR_ERROR,

    WND_ERR_CYCLE = 100001,
    WND_ERR_ALREADY_CHILD,
    WND_ERR_NOT_FOUND,

    VEC_OUT_OF_MEMORY = 200001,
    VEC_REALLOC_ERROR,
    VEC_COPY_ERROR,
    VEC_NULL_PTR_OR_EMPTY_ERROR,
    VEC_NO_NEED_RESIZE,
    VEC_INVALID_IDX,
} MErrorCode;

typedef struct {
    int base_code;          // 错误码起始值 (如 100001)
    const char** messages;  // 指向消息数组
    size_t msg_count;       // 消息数组长度
} ErrorCategory;

const char* get_error_message(MErrorCode code);

#endif
